package com.superitem.school.controller;

import com.superitem.school.pojo.User;
import com.superitem.school.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController //如果你只需要返回字符串
@RequestMapping
public class HelloController {
    @Autowired
   private UserService userService;

    @GetMapping("/user/{id}")
    public User queryById(@PathVariable Integer id){
        return userService.queryById(id);
    }
}
